package cn.newtouch.feign;


import cn.newtouch.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFallBackMethod implements FallbackFactory<UserFeignService> {

    @Override
    public UserFeignService create(Throwable throwable) {
        return new UserFeignService() {
            @Override
            public User getById(Long id) {
                return new User(-1L,"openFeign整合sentinel-触发熔断","熔断了！！！");
            }
        };
    }
}
